const mongoose = require("mongoose");
const uuid = require("uuid");

const serverSchema = new mongoose.Schema(
  {
    _id: {
      type: String,
      default: uuid.v1,
    },
    servers: {
      livingServer: {
        type: String,
        required: [true, "you must tell us your livingServer ip"],
      },
      mongoServer: {
        type: String,
        required: [true, "you must tell us your mongoServer ip"],
      },
      fileServer: {
        type: String,
        required: [true, "you must tell us your fileServer ip"],
      },
    },
    org_name: {
      type: String,
      ref: "Orgnization",
      required: [true, "A building must belong to one university or school"],
      unique:true,
    },
  },
  {
    _id: false,
  }
);
const Server = mongoose.model("Server", serverSchema);

module.exports = Server;
